<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
/*Route::get("/wel",function(){
   //$app=new \App\Service\TeleService();
    //dd(dispatch(new \App\Jobs\ExamleJob()));
   dd( Queue::push(new \App\Jobs\ExamleJob()));
    //$des=new \App\Service\DesService();
   $broker= new \App\Repository\BrokerRepository();
  $a= $broker->getVideo(\App\BrokerMedia::first());
    //$a= $des->decrypt('eNlwhEa4DDY=');

   $result=  $app->readFile('http://101.95.49.63/media/getMediaFile.do','20181112','291803253');


});*/


Route::get('/workshop','WorkshopController@index');
Route::get('/citylist','CityController@index')->name('cityList'); //选择城市
Route::get('/details','WorkshopController@details');//详情
Route::get('/city/sale/{ids?}','WorkshopController@city');//区域
Route::get('/area/sale/{id?}','WorkshopController@area');//面积

/*
*首页
*/
Route::get('/','IndexController@index');
Route::get('/hotsale','IndexController@hotsale');//热门搜索
Route::get('/search/sale','IndexController@search');//正常搜索
/*
 * about页面
 * */
Route::get('/about','AboutController@index');
//新闻
Route::get('/news/detail/{id}','NewsController@detail')->name('detail');
//园区控制器
Route::get('/park/detail','ParkController@detail')->name('park');
Route::get('/liuyan','LiuYanController@index')->name('liuyan');
Route::post('/liuyan','LiuYanController@submit')->name('liuyan.submit');
Route::get('/success','LiuYanController@success')->name('liuyan.success');

//Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
Route::prefix('huodong')->group(function(){
    Route::get('/','ActiveController@index');
    Route::post('/submit','ActiveController@submit')->name('active.submit');
});
Route::prefix('share')->middleware(['wechat.oauth'])->group(function(){
    Route::get('/user', function () {
        $user = session('wechat.oauth_user.default'); // 拿到授权用户资料
        //var_dump($user);
    });
    Route::get('/share/demo','mobile\share\ShareController@shareDemo');//分享朋友圈demo

    //分销
    Route::get('/distribution/{id}/{user_id?}','DistributionController@index')->name('distribution');
});